<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-天下商旅</title>
<link href="${ctx}/resources/css/page_member.css" rel="stylesheet" type="text/css">
<link href="${ctx}/resources/css/jbox_skin_blue/jbox.css" rel="stylesheet" type="text/css">
</head>

<body>

<jsp:include page="../commons/header.jsp" >
     <jsp:param name="currentMenu" value="menu3"/>
</jsp:include>



<div class="main_box">
<div class="main cf">

	<jsp:include page="../commons/left.jsp"></jsp:include>
		<div class="right">
		<div class="right_box" id="right_box">
		    <div class="title"><span><a href="#">申请升级</a></span></div>
			<div class="content cf">
				<div class="applyup_box">
					<img class="top_img" src="${ctx}/resources/img/top3.png">
					<form action="${ctx}/memberBI/applyUpgrade"  method="post">
                        <div>
							<label>被激活会员的账户</label>
                            ${mbi.baseUsername }
                        </div>
                        <div>
							<label>现金账户余额</label>
                            ${memberWallet.walletRemain}
                        </div>
                        <div>
							<label>目前级别</label>
                            			<c:if test="${registerInfo.registerGrade == 1}">铜旅<img src="${ctx}/resources/img/grade1.png"></c:if>
										<c:if test="${registerInfo.registerGrade == 2}">银旅<img src="${ctx}/resources/img/grade2.png"></c:if>
										<c:if test="${registerInfo.registerGrade == 5}">金旅<img src="${ctx}/resources/img/grade3.png"></c:if>
										<c:if test="${registerInfo.registerGrade == 10}">VIP旅<img src="${ctx}/resources/img/grade4.png"></c:if>
										<c:if test="${registerInfo.registerGrade == 30}">VIP钻石旅<img src="${ctx}/resources/img/grade5.png"></c:if>
                        </div>
                        <div>
							<label><i>* </i>加盟等级</label>
									<c:if test="${registerInfo.registerGrade < 1}"><input id="grade1" type="radio" checked="checked" value="1" name="grade"><label class="label" for="grade1">铜旅<img src="${ctx}/resources/img/grade1.png"></label></c:if>
									<c:if test="${registerInfo.registerGrade < 2}"><input id="grade2" type="radio" value="2" name="grade"><label class="label" for="grade2">银旅<img src="${ctx}/resources/img/grade2.png"></label></c:if>
									<c:if test="${registerInfo.registerGrade < 5}"><input id="grade3" type="radio" value="5" name="grade"><label class="label" for="grade3">金旅<img src="${ctx}/resources/img/grade3.png"></label></c:if>
									<c:if test="${registerInfo.registerGrade < 10}"><input id="grade4" type="radio" value="10" name="grade"><label class="label" for="grade4">VIP旅<img src="${ctx}/resources/img/grade4.png"></label></c:if>
									<c:if test="${registerInfo.registerGrade < 30}"><input id="grade5" type="radio" value="30" name="grade"><label class="label" for="grade5">VIP钻石旅<img src="${ctx}/resources/img/grade5.png"></label></c:if>
									<c:if test="${registerInfo.registerGrade == 30}"><label class="label" style="color:red" for="grade5">你已经是最高等级</label></c:if>
                        </div>
                        <div>
 							<label>&nbsp;</label>
							<input type="submit" class="submit btn_orange" value="提 交" />
                        </div>
					</form>
				</div>
			</div>
		</div>
	</div>
		
</div>
</div>

<jsp:include page="../commons/footer.jsp"></jsp:include>

<script src="${ctx}/resources/script/validate/jquery-1.4.min.js" type="text/javascript"></script>
<script src="${ctx}/resources/script/common.js"></script>
<script src="${ctx}/resources/script/jquery.jBox-2.3.min.js"></script>
<script src="${ctx}/resources/script/jquery.jBox-zh-CN.js"></script> 
<script type="text/javascript" src="${ctx}/resources/script/validate/jquery.validate.js"></script>
<script type="text/javascript" src="${ctx}/resources/script/validate/jquery.metadata.js"></script>
<script type="text/javascript" src="${ctx}/resources/script/validate/additional-methods.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/resources/script/validate/messages_cn.js" charset="utf-8"></script>
<script>
$.validator.setDefaults({
	submitHandler: function() { ajaxApplyUpgrade(); }
	});

function ajaxApplyUpgrade(){
	var url = "${ctx}/memberBI/applyUpgrade";
    $.ajax({
        type: "post",
        async:false,
        url: url,
        dataType: "json",
        data:$("form").serialize(),
        success: function(getmsg){  
            if(getmsg.code==0) {
        		//$.jBox(getmsg.context, {
        		//	title: "提示消息",
        		//	bottomText: ""
        		//});
        		alert(getmsg.context);
            } 
            else
            {
        		//$.jBox("升级成功", {
        		//	title: "提示消息",
        		//	bottomText: ""
        		//});
        		alert("升级成功");
        		window.location.href="${ctx}/memberBI/applyUpgradeIndex";
            }
        }
    });
}
	
$(function() {			
	   $("form").validate({
		   });	
	   });
	
</script>
</body>
</html>

